using System;
using Project.Models;
using Project.ViewModels.Abstractions;

namespace Project.ViewModels
{
    public class SlotViewModel : ViewModelBase<Slot>
    {
        private readonly ItemConfigsStorage _itemConfigsStorage;

        public SlotViewModel(Slot slot, ItemConfigsStorage itemConfigsStorage) : base(slot)
        {
            _itemConfigsStorage = itemConfigsStorage;

            ItemViewModel = new ItemViewModel(Model, _itemConfigsStorage);
        }

        public ItemViewModel ItemViewModel { get; private set; }

        public event Action ItemDropped;

        public void HandleDrop() => ItemDropped?.Invoke();
    }
}
